package org.xwalk.core;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.telephony.TelephonyManager;
import android.provider.Settings;
import android.webkit.WebSettings;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;



public class XWalkSettings   {

    /**
     * Default cache usage mode. If the navigation type doesn't impose any
     * specific behavior, use cached resources when they are available
     * and not expired, otherwise load resources from the network.
     * Use with {@link #setCacheMode}.
     * @since 7.0
     */
    public final static int LOAD_DEFAULT = -1;

    /**
     * Use cached resources when they are available, even if they have expired.
     * Otherwise load resources from the network.
     * Use with {@link #setCacheMode}.
     * @since 7.0
     */
    public final static int LOAD_CACHE_ELSE_NETWORK = 1;

    /**
     * Don't use the cache, load from the network.
     * Use with {@link #setCacheMode}.
     * @since 7.0
     */
    public final static int LOAD_NO_CACHE = 2;

    /**
     * Don't use the network, load from the cache.
     * Use with {@link #setCacheMode}.
     * @since 7.0
     */
    public final static int LOAD_CACHE_ONLY = 3;

    private ArrayList<Object> constructorTypes;
    private ArrayList<Object> constructorParams;
    private ReflectMethod postWrapperMethod;

    /**
     * This enum corresponds to WebSettings.LayoutAlgorithm.
     * @since 6.0
     */
    public enum LayoutAlgorithm {
        NORMAL,
        SINGLE_COLUMN,
        NARROW_COLUMNS,
        TEXT_AUTOSIZING
    }

    private ReflectMethod enumLayoutAlgorithmClassValueOfMethod = new ReflectMethod();

    private Object ConvertLayoutAlgorithm(LayoutAlgorithm type) {
        return enumLayoutAlgorithmClassValueOfMethod.invoke(type.toString());
    }

    private XWalkCoreWrapper coreWrapper;
    private Object bridge;

    protected Object getBridge() {
        return bridge;
    }

    public XWalkSettings(Object bridge) {
        this.bridge = bridge;
        reflectionInit();
    }

    /**
     * Overrides the way the cache is used. The way the cache is used is based
     * on the navigation type. For a normal page load, the cache is checked
     * and content is re-validated as needed. When navigating back, content is
     * not revalidated, instead the content is just retrieved from the cache.
     * This method allows the client to override this behavior by specifying
     * one of {@link #LOAD_DEFAULT},
     * {@link #LOAD_CACHE_ELSE_NETWORK}, {@link #LOAD_NO_CACHE} or
     * {@link #LOAD_CACHE_ONLY}. The default value is {@link #LOAD_DEFAULT}.
     *
     * @param mode the mode to use
     * @since 7.0
     */
    public void setCacheMode(int mode) {
        try {
            setCacheModeintMethod.invoke(mode);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setCacheModeintMethod = new ReflectMethod(null, "setCacheMode");

    /**
     * Gets the current setting for overriding the cache mode.
     *
     * @return the current setting for overriding the cache mode
     * @see #setCacheMode
     * @since 7.0
     */
    public int getCacheMode() {
        try {
            return (Integer)getCacheModeMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return 0;
    }

    private ReflectMethod getCacheModeMethod = new ReflectMethod(null, "getCacheMode");

    /**
     * Sets whether the XWalkView should not load resources from the network.
     * Use {@link #setBlockNetworkImage} to only avoid loading
     * image resources. Note that if the value of this setting is
     * changed from true to false, network resources referenced by content
     * currently displayed by the XWalkView are not fetched until
     * {@link org.xwalk.core.XWalkView#reload} is called.
     * If the application does not have the
     * {@link android.Manifest.permission#INTERNET} permission, attempts to set
     * a value of false will cause a {@link java.lang.SecurityException}
     * to be thrown. The default value is false if the application has the
     * {@link android.Manifest.permission#INTERNET} permission, otherwise it is
     * true.
     *
     * @param flag whether the XWalkView should not load any resources from the
     *             network
     * @see org.xwalk.core.XWalkView#reload
     * @since 7.0
     */
    public void setBlockNetworkLoads(boolean flag) {
        try {
            setBlockNetworkLoadsbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setBlockNetworkLoadsbooleanMethod = new ReflectMethod(null, "setBlockNetworkLoads");

    /**
     * Gets whether the XWalkView does not load any resources from the network.
     *
     * @return true if the XWalkView does not load any resources from the network
     * @see #setBlockNetworkLoads
     * @since 7.0
     */
    public boolean getBlockNetworkLoads() {
        try {
            return (Boolean)getBlockNetworkLoadsMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getBlockNetworkLoadsMethod = new ReflectMethod(null, "getBlockNetworkLoads");

    /**
     * Enables or disables file access within XWalkView. File access is enabled by
     * default. Note that this enables or disables file system access only.
     * Assets and resources are still accessible using file:///android_asset and
     * file:///android_res.
     *
     * @param allow whether file access is allowed
     * @since 7.0
     */
    public void setAllowFileAccess(boolean allow) {
        try {
            setAllowFileAccessbooleanMethod.invoke(allow);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setAllowFileAccessbooleanMethod = new ReflectMethod(null, "setAllowFileAccess");

    /**
     * Gets whether this XWalkView supports file access.
     *
     * @see #setAllowFileAccess
     * @return true if this XWalkView supports file access.
     * @since 7.0
     */
    public boolean getAllowFileAccess() {
        try {
            return (Boolean)getAllowFileAccessMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getAllowFileAccessMethod = new ReflectMethod(null, "getAllowFileAccess");

    /**
     * Enables or disables content URL access within XWalkView. Content URL
     * access allows XWalkView to load content from a content provider installed
     * in the system. The default is enabled.
     *
     * @param allow whether content URL access is allowed
     * @since 7.0
     */
    public void setAllowContentAccess(boolean allow) {
        try {
            setAllowContentAccessbooleanMethod.invoke(allow);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setAllowContentAccessbooleanMethod = new ReflectMethod(null, "setAllowContentAccess");

    /**
     * Gets whether this XWalkView supports content URL access.
     *
     * @see #setAllowContentAccess
     * @return true if this XWalkView supports content URL access.
     * @since 7.0
     */
    public boolean getAllowContentAccess() {
        try {
            return (Boolean)getAllowContentAccessMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getAllowContentAccessMethod = new ReflectMethod(null, "getAllowContentAccess");

    /**
     * Tells the XWalkView to enable JavaScript execution.
     * <b>The default is true.</b>
     * Note that the default value of this setting is different with WebView.
     *
     * @param flag true if the XWalkView should execute JavaScript
     * @since 7.0
     */
    public void setJavaScriptEnabled(boolean flag) {
        try {
            setJavaScriptEnabledbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setJavaScriptEnabledbooleanMethod = new ReflectMethod(null, "setJavaScriptEnabled");

    /**
     * Sets whether JavaScript running in the context of a file scheme URL
     * should be allowed to access content from any origin. This includes
     * access to content from other file scheme URLs. See
     * {@link #setAllowFileAccessFromFileURLs}. To enable the most restrictive,
     * and therefore secure policy, this setting should be disabled.
     * Note that this setting affects only JavaScript access to file scheme
     * resources. Other access to such resources, for example, from image HTML
     * elements, is unaffected. The default value is false.
     *
     * @param flag whether JavaScript running in the context of a file scheme
     *             URL should be allowed to access content from any origin
     * @since 7.0
     */
    public void setAllowUniversalAccessFromFileURLs(boolean flag) {
        try {
            setAllowUniversalAccessFromFileURLsbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setAllowUniversalAccessFromFileURLsbooleanMethod = new ReflectMethod(null, "setAllowUniversalAccessFromFileURLs");

    /**
     * Sets whether JavaScript running in the context of a file scheme URL
     * should be allowed to access content from other file scheme URLs. To
     * enable the most restrictive, and therefore secure policy, this setting
     * should be disabled. Note that the value of this setting is ignored if
     * the value of {@link #getAllowUniversalAccessFromFileURLs} is true.
     * Note too, that this setting affects only JavaScript access to file scheme
     * resources. Other access to such resources, for example, from image HTML
     * elements, is unaffected. The default value is false.
     *
     * @param flag whether JavaScript running in the context of a file scheme
     *             URL should be allowed to access content from other file
     *             scheme URLs
     * @since 7.0
     */
    public void setAllowFileAccessFromFileURLs(boolean flag) {
        try {
            setAllowFileAccessFromFileURLsbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setAllowFileAccessFromFileURLsbooleanMethod = new ReflectMethod(null, "setAllowFileAccessFromFileURLs");

    /**
     * Sets whether the XWalkView should load image resources. Note that this method
     * controls loading of all images, including those embedded using the data
     * URI scheme. Use {@link #setBlockNetworkImage} to control loading only
     * of images specified using network URI schemes. Note that if the value of this
     * setting is changed from false to true, all images resources referenced
     * by content currently displayed by the XWalkView are loaded automatically.
     * The default is true.
     *
     * @param flag whether the XWalkView should load image resources
     * @since 7.0
     */
    public void setLoadsImagesAutomatically(boolean flag) {
        try {
            setLoadsImagesAutomaticallybooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setLoadsImagesAutomaticallybooleanMethod = new ReflectMethod(null, "setLoadsImagesAutomatically");

    /**
     * Gets whether the XWalkView loads image resources. This includes
     * images embedded using the data URI scheme.
     *
     * @return true if the XWalkView loads image resources
     * @see #setLoadsImagesAutomatically
     * @since 7.0
     */
    public boolean getLoadsImagesAutomatically() {
        try {
            return (Boolean)getLoadsImagesAutomaticallyMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getLoadsImagesAutomaticallyMethod = new ReflectMethod(null, "getLoadsImagesAutomatically");

    /**
     * Sets whether the XWalkView should not load image resources from the
     * network (resources accessed via http and https URI schemes).  Note
     * that this method has no effect unless
     * {@link #getLoadsImagesAutomatically} returns true. Also note that
     * disabling all network loads using {@link #setBlockNetworkLoads}
     * will also prevent network images from loading, even if this flag is set
     * to false. When the value of this setting is changed from true to false,
     * network images resources referenced by content currently displayed by
     * the XWalkView are fetched automatically. The default is false.
     *
     * @param flag whether the XWalkView should not load image resources from the
     *             network
     * @see #setBlockNetworkLoads
     * @since 7.0
     */
    public void setBlockNetworkImage(boolean flag) {
        try {
            setBlockNetworkImagebooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setBlockNetworkImagebooleanMethod = new ReflectMethod(null, "setBlockNetworkImage");

    /**
     * Gets whether the XWalkView does not load image resources from the network.
     *
     * @return true if the XWalkView does not load image resources from the network
     * @see #setBlockNetworkImage
     * @since 7.0
     */
    public boolean getBlockNetworkImage() {
        try {
            return (Boolean)getBlockNetworkImageMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getBlockNetworkImageMethod = new ReflectMethod(null, "getBlockNetworkImage");

    /**
     * Gets whether JavaScript is enabled.
     *
     * @return true if JavaScript is enabled
     * @see #setJavaScriptEnabled
     * @since 7.0
     */
    public boolean getJavaScriptEnabled() {
        try {
            return (Boolean)getJavaScriptEnabledMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getJavaScriptEnabledMethod = new ReflectMethod(null, "getJavaScriptEnabled");

    /**
     * Gets whether JavaScript running in the context of a file scheme URL can
     * access content from any origin. This includes access to content from
     * other file scheme URLs.
     *
     * @return whether JavaScript running in the context of a file scheme URL
     *         can access content from any origin
     * @see #setAllowUniversalAccessFromFileURLs
     * @since 7.0
     */
    public boolean getAllowUniversalAccessFromFileURLs() {
        try {
            return (Boolean)getAllowUniversalAccessFromFileURLsMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getAllowUniversalAccessFromFileURLsMethod = new ReflectMethod(null, "getAllowUniversalAccessFromFileURLs");

    /**
     * Gets whether JavaScript running in the context of a file scheme URL can
     * access content from other file scheme URLs.
     *
     * @return whether JavaScript running in the context of a file scheme URL
     *         can access content from other file scheme URLs
     * @see #setAllowFileAccessFromFileURLs
     * @since 7.0
     */
    public boolean getAllowFileAccessFromFileURLs() {
        try {
            return (Boolean)getAllowFileAccessFromFileURLsMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getAllowFileAccessFromFileURLsMethod = new ReflectMethod(null, "getAllowFileAccessFromFileURLs");

    /**
     * Tells JavaScript to open windows automatically. This applies to the
     * JavaScript function window.open(). The default is true.
     *
     * @param flag true if JavaScript can open windows automatically
     * @since 7.0
     */
    public void setJavaScriptCanOpenWindowsAutomatically(boolean flag) {
        try {
            setJavaScriptCanOpenWindowsAutomaticallybooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setJavaScriptCanOpenWindowsAutomaticallybooleanMethod = new ReflectMethod(null, "setJavaScriptCanOpenWindowsAutomatically");

    /**
     * Gets whether JavaScript can open windows automatically.
     *
     * @return true if JavaScript can open windows automatically during
     *         window.open()
     * @see #setJavaScriptCanOpenWindowsAutomatically
     * @since 7.0
     */
    public boolean getJavaScriptCanOpenWindowsAutomatically() {
        try {
            return (Boolean)getJavaScriptCanOpenWindowsAutomaticallyMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getJavaScriptCanOpenWindowsAutomaticallyMethod = new ReflectMethod(null, "getJavaScriptCanOpenWindowsAutomatically");

    /**
     * Sets whether the XWalkView supports multiple windows. If set to
     * true, {@link XWalkUIClient#onCreateWindowRequested} must be implemented
     * by the host application. The default is false.
     *
     * @param support whether to suport multiple windows
     * @since 7.0
     */
    public void setSupportMultipleWindows(boolean support) {
        try {
            setSupportMultipleWindowsbooleanMethod.invoke(support);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setSupportMultipleWindowsbooleanMethod = new ReflectMethod(null, "setSupportMultipleWindows");

    /**
     * Gets whether the XWalkView supports multiple windows.
     *
     * @return true if the XWalkView supports multiple windows
     * @see #setSupportMultipleWindows
     * @since 7.0
     */
    public boolean supportMultipleWindows() {
        try {
            return (Boolean)supportMultipleWindowsMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod supportMultipleWindowsMethod = new ReflectMethod(null, "supportMultipleWindows");

    /**
     * Sets whether the XWalkView should enable support for the "viewport" HTML
     * meta tag or should use a wide viewport. When the value of the setting is
     * false, the layout width is always set to the width of the XWalkView control
     * in device-independent (CSS) pixels. When the value is true and the page
     * contains the viewport meta tag, the value of the width specified in the
     * tag is used. If the page does not contain the tag or does not provide a
     * width, then a wide viewport will be used.
     * @param use whether to enable support for the viewport meta tag.
     * @since 6.0
     */
    public void setUseWideViewPort(boolean use) {
        try {
            setUseWideViewPortbooleanMethod.invoke(use);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setUseWideViewPortbooleanMethod = new ReflectMethod(null, "setUseWideViewPort");

    /**
      * Gets whether the XWalkView supports the "viewport" HTML meta tag or will
      * use a wide viewport.
      * @return true if the XWalkView supports the viewport meta tag.
      * @since 6.0
      */
    public boolean getUseWideViewPort() {
        try {
            return (Boolean)getUseWideViewPortMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getUseWideViewPortMethod = new ReflectMethod(null, "getUseWideViewPort");

    /**
     * Sets whether the DOM storage API is enabled. The default value is true.
     * Note that the default value of this setting is different with WebView.
     *
     * @param flag true if the XWalkView should use the DOM storage API
     * @since 7.0
     */
    public void setDomStorageEnabled(boolean flag) {
        try {
            setDomStorageEnabledbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setDomStorageEnabledbooleanMethod = new ReflectMethod(null, "setDomStorageEnabled");

    /**
     * Gets whether the DOM Storage APIs are enabled.
     *
     * @return true if the DOM Storage APIs are enabled
     * @see #setDomStorageEnabled
     * @since 7.0
     */
    public boolean getDomStorageEnabled() {
        try {
            return (Boolean)getDomStorageEnabledMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getDomStorageEnabledMethod = new ReflectMethod(null, "getDomStorageEnabled");

    /**
     * Sets whether the database storage API is enabled. The default value is
     * true, which is different with WebView.
     *
     * This setting is global in effect, across all XWalkView instances in a process.
     * Note you should only modify this setting prior to making <b>any</b> XWalkView
     * page load within a given process, as the XWalkView implementation may ignore
     * changes to this setting after that point.
     *
     * @param flag true if the XWalkView should use the database storage API
     * @since 7.0
     */
    public void setDatabaseEnabled(boolean flag) {
        try {
            setDatabaseEnabledbooleanMethod.invoke(flag);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setDatabaseEnabledbooleanMethod = new ReflectMethod(null, "setDatabaseEnabled");

    /**
     * Gets whether the database storage API is enabled.
     *
     * @return true if the database storage API is enabled
     * @since 7.0
     */
    public boolean getDatabaseEnabled() {
        try {
            return (Boolean)getDatabaseEnabledMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getDatabaseEnabledMethod = new ReflectMethod(null, "getDatabaseEnabled");

    /**
     * Sets whether the XWalkView requires a user gesture to play media.
     * The default is false, which is different with WebView.
     *
     * @param require whether the XWalkView requires a user gesture to play media
     * @since 7.0
     */
    public void setMediaPlaybackRequiresUserGesture(boolean require) {
        try {
            setMediaPlaybackRequiresUserGesturebooleanMethod.invoke(require);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setMediaPlaybackRequiresUserGesturebooleanMethod = new ReflectMethod(null, "setMediaPlaybackRequiresUserGesture");

    /**
     * Gets whether the XWalkView requires a user gesture to play media.
     *
     * @return true if the XWalkView requires a user gesture to play media
     * @see #setMediaPlaybackRequiresUserGesture
     * @since 7.0
     */
    public boolean getMediaPlaybackRequiresUserGesture() {
        try {
            return (Boolean)getMediaPlaybackRequiresUserGestureMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getMediaPlaybackRequiresUserGestureMethod = new ReflectMethod(null, "getMediaPlaybackRequiresUserGesture");

    /**
     * Set the user agent of web page/app.
     * @param userAgent the user agent string passed from client.
     * @since 6.0
     */
    public void setUserAgentString(String userAgent) {
        try {
            setUserAgentStringStringMethod.invoke(userAgent);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setUserAgentStringStringMethod = new ReflectMethod(null, "setUserAgentString");

    /**
     * Get the user agent of web page/app.
     * @return the XWalkView's user-agent string.
     * @since 6.0
     */
    public String getUserAgentString() {
        try {
            return (String)getUserAgentStringMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return null;
    }

    private ReflectMethod getUserAgentStringMethod = new ReflectMethod(null, "getUserAgentString");

     /**
     * Set the accept languages of XWalkView.
     * @param acceptLanguages the accept languages string passed from client.
     * @since 6.0
     */
    public void setAcceptLanguages(final String acceptLanguages) {
        try {
            setAcceptLanguagesStringMethod.invoke(acceptLanguages);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setAcceptLanguagesStringMethod = new ReflectMethod(null, "setAcceptLanguages");

    /**
     * Get the accept languages of XWalkView.
     * @return the accept languages
     * @since 6.0
     */
    public String getAcceptLanguages() {
        try {
            return (String)getAcceptLanguagesMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return null;
    }

    private ReflectMethod getAcceptLanguagesMethod = new ReflectMethod(null, "getAcceptLanguages");

    /**
     * Sets whether the XWalkView should save form data. The default is true.
     *
     * @param enable whether the XWalkView should save form data
     * @since 7.0
     */
    public void setSaveFormData(final boolean enable) {
        try {
            setSaveFormDatabooleanMethod.invoke(enable);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setSaveFormDatabooleanMethod = new ReflectMethod(null, "setSaveFormData");

    /**
     * Gets whether the XWalkView saves form data.
     * @return whether the XWalkView saves form data
     * @see #setSaveFormData
     * @since 7.0
     */
    public boolean getSaveFormData() {
        try {
            return (Boolean)getSaveFormDataMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getSaveFormDataMethod = new ReflectMethod(null, "getSaveFormData");

    /**
     * Sets the initial scale for this XWalkView.
     * @param scaleInPercent the initial scale in percent.
     * @since 6.0
     */
    public void setInitialPageScale(final float scaleInPercent) {
        try {
            setInitialPageScalefloatMethod.invoke(scaleInPercent);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setInitialPageScalefloatMethod = new ReflectMethod(null, "setInitialPageScale");

    /**
     * Sets the text zoom of the page in percent. The default is 100.
     * @param textZoom the text zoom in percent.
     * @since 6.0
     */
    public void setTextZoom(final int textZoom) {
        try {
            setTextZoomintMethod.invoke(textZoom);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setTextZoomintMethod = new ReflectMethod(null, "setTextZoom");

    /**
     * Gets the text zoom of the page in percent.
     * @return the text zoom of the page in percent.
     * @since 6.0
     */
    public int getTextZoom() {
        try {
            return (Integer)getTextZoomMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return 0;
    }

    private ReflectMethod getTextZoomMethod = new ReflectMethod(null, "getTextZoom");

    /**
     * Sets the default font size. The default is 16.
     * @param size non-negative integer between 1 and 72.
     *             Any number outside the specified range will be pinned.
     * @since 6.0
     */
    public void setDefaultFontSize(int size) {
        try {
            setDefaultFontSizeintMethod.invoke(size);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setDefaultFontSizeintMethod = new ReflectMethod(null, "setDefaultFontSize");

    /**
     * Gets the default font size.
     * @return a non-negative integer between 1 and 72.
     * @since 6.0
     */
    public int getDefaultFontSize() {
        try {
            return (Integer)getDefaultFontSizeMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return 0;
    }

    private ReflectMethod getDefaultFontSizeMethod = new ReflectMethod(null, "getDefaultFontSize");

    /**
     * Sets the default fixed font size. The default is 16.
     * @param size a non-negative integer between 1 and 72.
     *             Any number outside the specified range will be pinned.
     * @since 6.0
     */
    public void setDefaultFixedFontSize(int size) {
        try {
            setDefaultFixedFontSizeintMethod.invoke(size);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setDefaultFixedFontSizeintMethod = new ReflectMethod(null, "setDefaultFixedFontSize");

    /**
     * Gets the default fixed font size.
     * @return a non-negative integer between 1 and 72.
     * @since 6.0
     */
    public int getDefaultFixedFontSize() {
        try {
            return (Integer)getDefaultFixedFontSizeMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return 0;
    }

    private ReflectMethod getDefaultFixedFontSizeMethod = new ReflectMethod(null, "getDefaultFixedFontSize");

    /**
     * Sets whether the XWalkView should support zooming using its on-screen zoom controls
     * and gestures. The particular zoom mechanisms that should be used can be set with
     * setBuiltInZoomControls(boolean). This setting does not affect zooming performed
     * using the zoomIn() and zoomOut() methods. The default is true.
     * @param support whether the XWalkView should support zoom.
     * @since 6.0
     */
    public void setSupportZoom(boolean support) {
        try {
            setSupportZoombooleanMethod.invoke(support);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setSupportZoombooleanMethod = new ReflectMethod(null, "setSupportZoom");

    /**
     * Gets whether the XWalkView supports zoom.
     * @return true if the XWalkView supports zoom.
     * @since 6.0
     */
    public boolean supportZoom() {
        try {
            return (Boolean)supportZoomMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod supportZoomMethod = new ReflectMethod(null, "supportZoom");

    /**
     * Sets whether the XWalkView should use its built-in zoom mechanisms.
     * The built-in zoom mechanisms comprise on-screen zoom controls, which are
     * displayed over the XWalkView's content, and the use of a pinch gesture to
     * control zooming. Whether or not these on-screen controls are displayed
     * can be set with setDisplayZoomControls(boolean). The default is false.
     * @param enabled whether the XWalkView should use its built-in zoom mechanisms.
     * @since 6.0
     */
    public void setBuiltInZoomControls(boolean enabled) {
        try {
            setBuiltInZoomControlsbooleanMethod.invoke(enabled);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setBuiltInZoomControlsbooleanMethod = new ReflectMethod(null, "setBuiltInZoomControls");

    /**
     * Gets whether the zoom mechanisms built into XWalkView are being used.
     * @return true if the zoom mechanisms built into XWalkView are being used.
     * @since 6.0
     */
    public boolean getBuiltInZoomControls() {
        try {
            return (Boolean)getBuiltInZoomControlsMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getBuiltInZoomControlsMethod = new ReflectMethod(null, "getBuiltInZoomControls");

    /**
     * Note: Just for test case.
     * Gets whether the XWalkView supports multi touch zoom.
     * @return true if the XWalkView supports multi touch zoom.
     */
    public boolean supportsMultiTouchZoomForTest() {
        try {
            return (Boolean)supportsMultiTouchZoomForTestMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod supportsMultiTouchZoomForTestMethod = new ReflectMethod(null, "supportsMultiTouchZoomForTest");

    /**
     * Sets whether the XWalkView should support the spatial navigation,
     * like a TV remote control.
     * @param enable whether the XWalkView should support the spatial navigation.
     * @since 6.0
     */
    public void setSupportSpatialNavigation(boolean enable) {
        try {
            setSupportSpatialNavigationbooleanMethod.invoke(enable);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setSupportSpatialNavigationbooleanMethod = new ReflectMethod(null, "setSupportSpatialNavigation");

    /**
     * Gets whether the XWalkView should support the spatial navigation.
     * @return true if XWalkView support the spatial navigation.
     * @since 6.0
     */
    public boolean getSupportSpatialNavigation() {
        try {
            return (Boolean)getSupportSpatialNavigationMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getSupportSpatialNavigationMethod = new ReflectMethod(null, "getSupportSpatialNavigation");

    /**
     * Sets whether the XWalkView should support the quirks mode.
     * @param enable whether the XWalkView should support the quirks mode.
     * @since 6.0
     */
    public void setSupportQuirksMode(boolean enable) {
        try {
            setSupportQuirksModebooleanMethod.invoke(enable);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setSupportQuirksModebooleanMethod = new ReflectMethod(null, "setSupportQuirksMode");

    /**
     * Gets whether the XWalkView should support the quirks mode.
     * @return true if XWalkView supports the quirks mode.
     * @since 6.0
     */
    public boolean getSupportQuirksMode() {
        try {
            return (Boolean)getSupportQuirksModeMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getSupportQuirksModeMethod = new ReflectMethod(null, "getSupportQuirksMode");

    /**
     * Sets the underlying layout algorithm.
     * This will cause a relayout of the XWalkView. The default is NARROW_COLUMNS.
     * @param la the layout algorithm to use.
     * @since 6.0
     */
    public void setLayoutAlgorithm(LayoutAlgorithm la) {
        try {
            setLayoutAlgorithmLayoutAlgorithmInternalMethod.invoke(ConvertLayoutAlgorithm(la));
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setLayoutAlgorithmLayoutAlgorithmInternalMethod = new ReflectMethod(null, "setLayoutAlgorithm");

    /**
     * Gets the current layout algorithm.
     * @return the layout algorithm in use.
     * @since 6.0
     */
    public LayoutAlgorithm getLayoutAlgorithm() {
        try {
            return (LayoutAlgorithm) LayoutAlgorithm.valueOf(getLayoutAlgorithmMethod.invoke().toString());
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return null;
    }

    private ReflectMethod getLayoutAlgorithmMethod = new ReflectMethod(null, "getLayoutAlgorithm");

    /**
     * Sets whether the XWalkView loads pages in overview mode, that is, zooms out
     * the content to fit on screen by width. This setting is taken into account
     * when the content width is greater than the width of the XWalkView control,
     * for example, when getUseWideViewPort() is enabled. The default is false.
     * @param overview whether this XWalkView loads pages in overview mode.
     * @since 7.0
     */
    public void setLoadWithOverviewMode(boolean overview) {
        try {
            setLoadWithOverviewModebooleanMethod.invoke(overview);
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        
    }

    private ReflectMethod setLoadWithOverviewModebooleanMethod = new ReflectMethod(null, "setLoadWithOverviewMode");

    /**
     * Gets whether this XWalkView loads pages in overview mode.
     * @return whether this XWalkView loads pages in overview mode.
     * @since 7.0
     */
    public boolean getLoadWithOverviewMode() {
        try {
            return (Boolean)getLoadWithOverviewModeMethod.invoke();
        } catch (UnsupportedOperationException e) {
            if (coreWrapper == null) {
                throw new RuntimeException("Crosswalk's APIs are not ready yet");
            } else {
                XWalkCoreWrapper.handleRuntimeError(e);
            }
        }
        return false;
    }

    private ReflectMethod getLoadWithOverviewModeMethod = new ReflectMethod(null, "getLoadWithOverviewMode");


    void reflectionInit() {
        XWalkCoreWrapper.initEmbeddedMode();

        coreWrapper = XWalkCoreWrapper.getInstance();
        if (coreWrapper == null) {
            XWalkCoreWrapper.reserveReflectObject(this);
            return;
        }

        enumLayoutAlgorithmClassValueOfMethod.init(null,
                coreWrapper.getBridgeClass("XWalkSettingsInternal$LayoutAlgorithmInternal"), "valueOf", String.class);

        setCacheModeintMethod.init(bridge, null,
                "setCacheModeSuper", int.class);
        getCacheModeMethod.init(bridge, null,
                "getCacheModeSuper");
        setBlockNetworkLoadsbooleanMethod.init(bridge, null,
                "setBlockNetworkLoadsSuper", boolean.class);
        getBlockNetworkLoadsMethod.init(bridge, null,
                "getBlockNetworkLoadsSuper");
        setAllowFileAccessbooleanMethod.init(bridge, null,
                "setAllowFileAccessSuper", boolean.class);
        getAllowFileAccessMethod.init(bridge, null,
                "getAllowFileAccessSuper");
        setAllowContentAccessbooleanMethod.init(bridge, null,
                "setAllowContentAccessSuper", boolean.class);
        getAllowContentAccessMethod.init(bridge, null,
                "getAllowContentAccessSuper");
        setJavaScriptEnabledbooleanMethod.init(bridge, null,
                "setJavaScriptEnabledSuper", boolean.class);
        setAllowUniversalAccessFromFileURLsbooleanMethod.init(bridge, null,
                "setAllowUniversalAccessFromFileURLsSuper", boolean.class);
        setAllowFileAccessFromFileURLsbooleanMethod.init(bridge, null,
                "setAllowFileAccessFromFileURLsSuper", boolean.class);
        setLoadsImagesAutomaticallybooleanMethod.init(bridge, null,
                "setLoadsImagesAutomaticallySuper", boolean.class);
        getLoadsImagesAutomaticallyMethod.init(bridge, null,
                "getLoadsImagesAutomaticallySuper");
        setBlockNetworkImagebooleanMethod.init(bridge, null,
                "setBlockNetworkImageSuper", boolean.class);
        getBlockNetworkImageMethod.init(bridge, null,
                "getBlockNetworkImageSuper");
        getJavaScriptEnabledMethod.init(bridge, null,
                "getJavaScriptEnabledSuper");
        getAllowUniversalAccessFromFileURLsMethod.init(bridge, null,
                "getAllowUniversalAccessFromFileURLsSuper");
        getAllowFileAccessFromFileURLsMethod.init(bridge, null,
                "getAllowFileAccessFromFileURLsSuper");
        setJavaScriptCanOpenWindowsAutomaticallybooleanMethod.init(bridge, null,
                "setJavaScriptCanOpenWindowsAutomaticallySuper", boolean.class);
        getJavaScriptCanOpenWindowsAutomaticallyMethod.init(bridge, null,
                "getJavaScriptCanOpenWindowsAutomaticallySuper");
        setSupportMultipleWindowsbooleanMethod.init(bridge, null,
                "setSupportMultipleWindowsSuper", boolean.class);
        supportMultipleWindowsMethod.init(bridge, null,
                "supportMultipleWindowsSuper");
        setUseWideViewPortbooleanMethod.init(bridge, null,
                "setUseWideViewPortSuper", boolean.class);
        getUseWideViewPortMethod.init(bridge, null,
                "getUseWideViewPortSuper");
        setDomStorageEnabledbooleanMethod.init(bridge, null,
                "setDomStorageEnabledSuper", boolean.class);
        getDomStorageEnabledMethod.init(bridge, null,
                "getDomStorageEnabledSuper");
        setDatabaseEnabledbooleanMethod.init(bridge, null,
                "setDatabaseEnabledSuper", boolean.class);
        getDatabaseEnabledMethod.init(bridge, null,
                "getDatabaseEnabledSuper");
        setMediaPlaybackRequiresUserGesturebooleanMethod.init(bridge, null,
                "setMediaPlaybackRequiresUserGestureSuper", boolean.class);
        getMediaPlaybackRequiresUserGestureMethod.init(bridge, null,
                "getMediaPlaybackRequiresUserGestureSuper");
        setUserAgentStringStringMethod.init(bridge, null,
                "setUserAgentStringSuper", String.class);
        getUserAgentStringMethod.init(bridge, null,
                "getUserAgentStringSuper");
        setAcceptLanguagesStringMethod.init(bridge, null,
                "setAcceptLanguagesSuper", String.class);
        getAcceptLanguagesMethod.init(bridge, null,
                "getAcceptLanguagesSuper");
        setSaveFormDatabooleanMethod.init(bridge, null,
                "setSaveFormDataSuper", boolean.class);
        getSaveFormDataMethod.init(bridge, null,
                "getSaveFormDataSuper");
        setInitialPageScalefloatMethod.init(bridge, null,
                "setInitialPageScaleSuper", float.class);
        setTextZoomintMethod.init(bridge, null,
                "setTextZoomSuper", int.class);
        getTextZoomMethod.init(bridge, null,
                "getTextZoomSuper");
        setDefaultFontSizeintMethod.init(bridge, null,
                "setDefaultFontSizeSuper", int.class);
        getDefaultFontSizeMethod.init(bridge, null,
                "getDefaultFontSizeSuper");
        setDefaultFixedFontSizeintMethod.init(bridge, null,
                "setDefaultFixedFontSizeSuper", int.class);
        getDefaultFixedFontSizeMethod.init(bridge, null,
                "getDefaultFixedFontSizeSuper");
        setSupportZoombooleanMethod.init(bridge, null,
                "setSupportZoomSuper", boolean.class);
        supportZoomMethod.init(bridge, null,
                "supportZoomSuper");
        setBuiltInZoomControlsbooleanMethod.init(bridge, null,
                "setBuiltInZoomControlsSuper", boolean.class);
        getBuiltInZoomControlsMethod.init(bridge, null,
                "getBuiltInZoomControlsSuper");
        supportsMultiTouchZoomForTestMethod.init(bridge, null,
                "supportsMultiTouchZoomForTestSuper");
        setSupportSpatialNavigationbooleanMethod.init(bridge, null,
                "setSupportSpatialNavigationSuper", boolean.class);
        getSupportSpatialNavigationMethod.init(bridge, null,
                "getSupportSpatialNavigationSuper");
        setSupportQuirksModebooleanMethod.init(bridge, null,
                "setSupportQuirksModeSuper", boolean.class);
        getSupportQuirksModeMethod.init(bridge, null,
                "getSupportQuirksModeSuper");
        setLayoutAlgorithmLayoutAlgorithmInternalMethod.init(bridge, null,
                "setLayoutAlgorithmSuper", coreWrapper.getBridgeClass("XWalkSettingsInternal$LayoutAlgorithmInternal"));
        getLayoutAlgorithmMethod.init(bridge, null,
                "getLayoutAlgorithmSuper");
        setLoadWithOverviewModebooleanMethod.init(bridge, null,
                "setLoadWithOverviewModeSuper", boolean.class);
        getLoadWithOverviewModeMethod.init(bridge, null,
                "getLoadWithOverviewModeSuper");
    }

}
